﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Xiaov.SmartWeb.Application.SysAdmin;
using Xiaov.SmartWeb.Model;
using Xiaov.SmartWeb.Model.ActiveRecord;
using Xiaov.SmartWeb.Infrastructure.ExtMethod;
using AjaxPro;

namespace Xiaov.SmartWeb.Application
{
    public partial class Default : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(Xiaov.SmartWeb.Application.SysAdmin.Admin_User));
            AjaxPro.Utility.RegisterTypeForAjax(typeof(Xiaov.SmartWeb.Application.Default));
        }

        /// <summary>
        /// 获取用户的树菜单
        /// </summary>
        /// <returns></returns>
        [AjaxPro.AjaxMethod]
        public string GetTree()
        {
            S_PM_MODULE module = new S_PM_MODULE();
            IList<S_PM_MODULE> list = module.GetModuleByUser(Page.User.Identity.Name);
            return list.ToDataTable().ToJsonForTree("MODULEID","MODULENAME" ,"PARENTMODULEID", "0","MODULEURL");
        }
    }
}